<template>
	<view class="container">
		<view class="clock-record">
			<view class="clock-record__title">6月汇总</view>
			<view class="clock-record__rows">
				<view class="clock-record__cell">
					<text>{{detail.hours}}</text>月总工时（小时）
				</view>
				<!-- <view class="clock-record__cell">
					<text>{{detail.bu_ci}}</text>补卡（次）
				</view> -->
				<view class="clock-record__cell">
					<text>{{detail.que_ci}}</text>缺卡（次）
				</view>
			</view>
		</view>
		<view class="clock-record">
			<view class="clock-record__title">每日记录<text>（6月）</text></view>
			<view class="clock-record__week">
				<wd-calendar-week @click="weekClick"></wd-calendar-week>
			</view>
			<view class="clock-record__line">
				<view class="clock-record__line-item" v-if="daka.shang.daka_status">
					<view  class="title">上班打卡  {{daka.shang.createtime_text}} <u-tag mode="plain" shape="circle" border-color="#6D4BBE" color="#6D4BBE" text="正常" /></view>
					<view class="subtit"></view>
				</view>
				<view class="clock-record__line-item" v-else>
					<view class="title">上班打卡 <u-tag mode="plain" shape="circle" border-color="#EE0000" color="#EE0000" text="缺卡" /></view>
					<view class="subtit"></view>
				</view>
				<view class="clock-record__line-item" v-if="daka.xia.daka_status">
					<view  class="title">下班打卡  {{daka.xia.createtime_text}} <u-tag mode="plain" shape="circle" border-color="#6D4BBE" color="#6D4BBE" text="正常" /></view>
					<view class="subtit"></view>
				</view>
				<view class="clock-record__line-item" v-else>
					<view class="title">下班打卡 <u-tag mode="plain" shape="circle" border-color="#EE0000" color="#EE0000" text="缺卡" /></view>
					<view class="subtit"></view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>

	export default {
		data() {
			return {
				date:'',
				detail:{},
				daka:{}
			}
		},
		onLoad(){
			this.getTotal();
			this.getDateDaka();
		},
		methods: {
			getTotal(){
				var that = this;
				var option = {
					tip_status: false,
					method: 'POST',
					tips: 'loading',
					url: 'api/teacher/daka_log',
					data: {}
				};
							
				http.common_request(that,option,function(data){
					that.detail = data.data
				})
			},
			getDateDaka(){
				var that = this;
				var date = that.date;
				var option = {
					tip_status: false,
					method: 'POST',
					tips: 'loading',
					url: 'api/teacher/date_log',
					data: {date:date}
				};
							
				http.common_request(that,option,function(data){
					that.daka = data.data;
				})
			},
			weekClick(date) {
				console.log(date);
				this.date = date;
			},
		}
	}
</script>

<style lang="scss" scoped>
	.container {
		padding: 1rpx 0;
		background: #F6F6F6;
	}
	.clock-record {
		margin: 24rpx;
		background: #FFFFFF;
		border-radius: 24rpx;
		overflow: hidden;
		&__title {
			padding: 30rpx 34rpx 0;
			line-height: 50rpx;
			font-size: 32rpx;
			font-weight: 500;
			color: #333333;
			text {
				font-size: 24rpx;
				font-weight: 400;
			}
		}
		&__rows {
			display: flex;
			align-items: center;
			padding: 30rpx 0;
		}
		&__cell {
			flex: 1;
			overflow: hidden;
			text-align: center;
			line-height: 38rpx;
			font-size: 24rpx;
			color: #333333;
			text {
				display: block;
				line-height: 78rpx;
				font-size: 50rpx;
				font-weight: 600;
			}
		}
		&__week {
			padding: 20rpx 0;
		}
		&__line {
			border-top: 1rpx #EDEDED solid;
			padding: 40rpx;
			/deep/ .u-dot {
				background: linear-gradient(131deg, #A36BFF 0%, #6D4BBE 100%);
			}
			/deep/ .u-time-axis::before {
				border-left-color: rgba(109, 75, 190, 0.15);
			}
			/deep/ .u-tag {
				display: inline-block;
				vertical-align: middle;
				margin-top: -6rpx;
				margin-left: 10rpx;
				padding: 8rpx 20rpx;
			}
			&-item {
				position: relative;
				padding: 20rpx 0;
				padding-left: 40rpx;
				&::before {
					content: "";
					position: absolute;
					top: 37rpx;
					left: 8rpx;
					display: block;
					width: 1rpx;
					height: 100%;
					background: rgba(109, 75, 190, 0.15);
				}
				&::after {
					content: "";
					position: absolute;
					top: 37rpx;
					left: 0;
					display: block;
					width: 16rpx;
					height: 16rpx;
					background: linear-gradient(131deg, #A36BFF 0%, #6D4BBE 100%);
					border-radius: 50%;
				}
				&:last-child:before {
					display: none;
				}
				.title {
					line-height: 50rpx;
					font-size: 32rpx;
					font-weight: 500;
					color: #333333;
				}
				.subtit {
					margin-top: 10rpx;
					line-height: 38rpx;
					font-size: 26rpx;
					color: #333333;
				}
			}
			
		}
	}
</style>